﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WXYW.BLL;
using WXYW.DAL;

namespace WXYW
{
    public partial class GiveFeedback : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            ApplicationService service = new ApplicationService();
            ApplicationForm form = service.GetApplicationFormByID(long.Parse(Request.QueryString[Constants.QUERYSTR_APPLICATION_ID]));
            ConfirmReceiveProduct confirmRecord = new ConfirmReceiveProduct
            {
                //Comment = commentTextBox.Text,
                //ConfirmReceiveDateTime = DateTime.Now,
                //ConfirmWay = wayRadioButtonList.SelectedValue,
                IsReceiveProduct = statusRadioList.SelectedIndex == 0 ? false : true
            };
            form.ConfirmReceiveProduct.Add(confirmRecord);
            form.ClientReceiveDateTime = DateTime.Now;
            form.Status = "客户信息反馈";
            service.UpdateApplication(form);
            
            service.SaveFeedback(long.Parse(Request.QueryString[Constants.QUERYSTR_APPLICATION_ID]), RadioButtonList1.SelectedValue, TextBox1.Text, RadioButtonList2.SelectedValue, TextBox2.Text, RadioButtonList3.SelectedValue, TextBox3.Text, RadioButtonList4.SelectedValue, TextBox4.Text, RadioButtonList5.SelectedValue, TextBox5.Text, RadioButtonList6.SelectedValue, TextBox6.Text, RadioButtonList7.SelectedValue, TextBox7.Text, RadioButtonList8.SelectedValue, TextBox8.Text);
        }
    }
}
